/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package sysmodel.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import sysmodel.Association;
import sysmodel.AssociationEnd;
import sysmodel.Attribute;
import sysmodel.AttributeConstraints;
import sysmodel.BusinessServiceParameter;
import sysmodel.Constraint;
import sysmodel.DataType;
import sysmodel.Entity;
import sysmodel.Enumeration;
import sysmodel.FeatureType;
import sysmodel.GeneratorModel;
import sysmodel.HttpMethod;
import sysmodel.J2eeBusinessComponent;
import sysmodel.J2eeBusinessService;
import sysmodel.J2eeRestComponent;
import sysmodel.J2eeRestService;
import sysmodel.Literal;
import sysmodel.Multiplicity;
import sysmodel.OSGiBusinessComponent;
import sysmodel.OSGiBusinessService;
import sysmodel.OSGiRestComponent;
import sysmodel.OSGiRestService;
import sysmodel.Property;
import sysmodel.RestServiceParameter;
import sysmodel.ReturnType;
import sysmodel.ServiceParameter;
import sysmodel.SysmodelFactory;
import sysmodel.SysmodelPackage;
import sysmodel.SystemModel;
import sysmodel.dotNetBusinessComponent;
import sysmodel.dotNetBusinessService;
import sysmodel.dotNetRestComponent;
import sysmodel.dotNetRestService;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class SysmodelFactoryImpl extends EFactoryImpl implements SysmodelFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static SysmodelFactory init() {
		try {
			SysmodelFactory theSysmodelFactory = (SysmodelFactory)EPackage.Registry.INSTANCE.getEFactory("http://systemmodel/1.0"); 
			if (theSysmodelFactory != null) {
				return theSysmodelFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new SysmodelFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SysmodelFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case SysmodelPackage.SYSTEM_MODEL: return createSystemModel();
			case SysmodelPackage.DATA_TYPE: return createDataType();
			case SysmodelPackage.ENTITY: return createEntity();
			case SysmodelPackage.ATTRIBUTE: return createAttribute();
			case SysmodelPackage.J2EE_BUSINESS_COMPONENT: return createJ2eeBusinessComponent();
			case SysmodelPackage.J2EE_REST_COMPONENT: return createJ2eeRestComponent();
			case SysmodelPackage.REST_SERVICE_PARAMETER: return createRestServiceParameter();
			case SysmodelPackage.DOT_NET_REST_COMPONENT: return createdotNetRestComponent();
			case SysmodelPackage.DOT_NET_BUSINESS_COMPONENT: return createdotNetBusinessComponent();
			case SysmodelPackage.J2EE_BUSINESS_SERVICE: return createJ2eeBusinessService();
			case SysmodelPackage.DOT_NET_BUSINESS_SERVICE: return createdotNetBusinessService();
			case SysmodelPackage.CONSTRAINT: return createConstraint();
			case SysmodelPackage.J2EE_REST_SERVICE: return createJ2eeRestService();
			case SysmodelPackage.DOT_NET_REST_SERVICE: return createdotNetRestService();
			case SysmodelPackage.FEATURE_TYPE: return createFeatureType();
			case SysmodelPackage.SERVICE_PARAMETER: return createServiceParameter();
			case SysmodelPackage.BUSINESS_SERVICE_PARAMETER: return createBusinessServiceParameter();
			case SysmodelPackage.LITERAL: return createLiteral();
			case SysmodelPackage.ENUMERATION: return createEnumeration();
			case SysmodelPackage.ASSOCIATION: return createAssociation();
			case SysmodelPackage.ASSOCIATION_END: return createAssociationEnd();
			case SysmodelPackage.OS_GI_REST_SERVICE: return createOSGiRestService();
			case SysmodelPackage.OS_GI_BUSINESS_COMPONENT: return createOSGiBusinessComponent();
			case SysmodelPackage.OS_GI_BUSINESS_SERVICE: return createOSGiBusinessService();
			case SysmodelPackage.OS_GI_REST_COMPONENT: return createOSGiRestComponent();
			case SysmodelPackage.EXCEPTION: return createException();
			case SysmodelPackage.RETURN_TYPE: return createReturnType();
			case SysmodelPackage.PROPERTY: return createProperty();
			case SysmodelPackage.GENERATOR_MODEL: return createGeneratorModel();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case SysmodelPackage.HTTP_METHOD:
				return createHttpMethodFromString(eDataType, initialValue);
			case SysmodelPackage.MULTIPLICITY:
				return createMultiplicityFromString(eDataType, initialValue);
			case SysmodelPackage.ATTRIBUTE_CONSTRAINTS:
				return createAttributeConstraintsFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case SysmodelPackage.HTTP_METHOD:
				return convertHttpMethodToString(eDataType, instanceValue);
			case SysmodelPackage.MULTIPLICITY:
				return convertMultiplicityToString(eDataType, instanceValue);
			case SysmodelPackage.ATTRIBUTE_CONSTRAINTS:
				return convertAttributeConstraintsToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SystemModel createSystemModel() {
		SystemModelImpl systemModel = new SystemModelImpl();
		return systemModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DataType createDataType() {
		DataTypeImpl dataType = new DataTypeImpl();
		return dataType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Entity createEntity() {
		EntityImpl entity = new EntityImpl();
		return entity;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Attribute createAttribute() {
		AttributeImpl attribute = new AttributeImpl();
		return attribute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public J2eeBusinessComponent createJ2eeBusinessComponent() {
		J2eeBusinessComponentImpl j2eeBusinessComponent = new J2eeBusinessComponentImpl();
		return j2eeBusinessComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public J2eeRestComponent createJ2eeRestComponent() {
		J2eeRestComponentImpl j2eeRestComponent = new J2eeRestComponentImpl();
		return j2eeRestComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RestServiceParameter createRestServiceParameter() {
		RestServiceParameterImpl restServiceParameter = new RestServiceParameterImpl();
		return restServiceParameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public dotNetRestComponent createdotNetRestComponent() {
		dotNetRestComponentImpl dotNetRestComponent = new dotNetRestComponentImpl();
		return dotNetRestComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public dotNetBusinessComponent createdotNetBusinessComponent() {
		dotNetBusinessComponentImpl dotNetBusinessComponent = new dotNetBusinessComponentImpl();
		return dotNetBusinessComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public J2eeBusinessService createJ2eeBusinessService() {
		J2eeBusinessServiceImpl j2eeBusinessService = new J2eeBusinessServiceImpl();
		return j2eeBusinessService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public dotNetBusinessService createdotNetBusinessService() {
		dotNetBusinessServiceImpl dotNetBusinessService = new dotNetBusinessServiceImpl();
		return dotNetBusinessService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Constraint createConstraint() {
		ConstraintImpl constraint = new ConstraintImpl();
		return constraint;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public J2eeRestService createJ2eeRestService() {
		J2eeRestServiceImpl j2eeRestService = new J2eeRestServiceImpl();
		return j2eeRestService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public dotNetRestService createdotNetRestService() {
		dotNetRestServiceImpl dotNetRestService = new dotNetRestServiceImpl();
		return dotNetRestService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FeatureType createFeatureType() {
		FeatureTypeImpl featureType = new FeatureTypeImpl();
		return featureType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ServiceParameter createServiceParameter() {
		ServiceParameterImpl serviceParameter = new ServiceParameterImpl();
		return serviceParameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BusinessServiceParameter createBusinessServiceParameter() {
		BusinessServiceParameterImpl businessServiceParameter = new BusinessServiceParameterImpl();
		return businessServiceParameter;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Literal createLiteral() {
		LiteralImpl literal = new LiteralImpl();
		return literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumeration createEnumeration() {
		EnumerationImpl enumeration = new EnumerationImpl();
		return enumeration;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Association createAssociation() {
		AssociationImpl association = new AssociationImpl();
		return association;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AssociationEnd createAssociationEnd() {
		AssociationEndImpl associationEnd = new AssociationEndImpl();
		return associationEnd;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OSGiRestService createOSGiRestService() {
		OSGiRestServiceImpl osGiRestService = new OSGiRestServiceImpl();
		return osGiRestService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OSGiBusinessComponent createOSGiBusinessComponent() {
		OSGiBusinessComponentImpl osGiBusinessComponent = new OSGiBusinessComponentImpl();
		return osGiBusinessComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OSGiBusinessService createOSGiBusinessService() {
		OSGiBusinessServiceImpl osGiBusinessService = new OSGiBusinessServiceImpl();
		return osGiBusinessService;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public OSGiRestComponent createOSGiRestComponent() {
		OSGiRestComponentImpl osGiRestComponent = new OSGiRestComponentImpl();
		return osGiRestComponent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public sysmodel.Exception createException() {
		ExceptionImpl exception = new ExceptionImpl();
		return exception;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReturnType createReturnType() {
		ReturnTypeImpl returnType = new ReturnTypeImpl();
		return returnType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Property createProperty() {
		PropertyImpl property = new PropertyImpl();
		return property;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GeneratorModel createGeneratorModel() {
		GeneratorModelImpl generatorModel = new GeneratorModelImpl();
		return generatorModel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HttpMethod createHttpMethodFromString(EDataType eDataType, String initialValue) {
		HttpMethod result = HttpMethod.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertHttpMethodToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Multiplicity createMultiplicityFromString(EDataType eDataType, String initialValue) {
		Multiplicity result = Multiplicity.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertMultiplicityToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AttributeConstraints createAttributeConstraintsFromString(EDataType eDataType, String initialValue) {
		AttributeConstraints result = AttributeConstraints.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertAttributeConstraintsToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SysmodelPackage getSysmodelPackage() {
		return (SysmodelPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static SysmodelPackage getPackage() {
		return SysmodelPackage.eINSTANCE;
	}

} //SysmodelFactoryImpl
